package com.gxa.controller;

import com.gxa.dto.MyParam;
import com.gxa.dto.ResultDto;
import com.gxa.service.impl.AdminServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AdminController {
    @Autowired
    private AdminServiceImpl adminService;


    @RequestMapping("/admin/list/page")
    private String adminListPage(){
        return "admin/admin-list";
    }

    @RequestMapping("/admin/list/show")
    @ResponseBody
    private ResultDto showTable(MyParam myParam){
        return adminService.showTable(myParam);
    }

    @RequestMapping("/admin/list/delete")
    @ResponseBody
    private ResultDto delete(Integer userId){
        return adminService.delete(userId);
    }

    @RequestMapping("/admin/add/page")
    private String adminAddPage(){
        return "admin/admin-add";
    }
}
